A semiconductor device in which a semiconductor element and a heat sink are joined with solder has been developed There is a difference in a thermal expansion coefficient between the semiconductor element and the heat sink. Accordingly, as a temperature of the semiconductor device changes, there arises a difference in an amount of dimension change between the semiconductor element and the heat sink. The difference in the amount of dimension change is large on a diagonal line of the semiconductor element. Accordingly, thermal stress is likely to occur at four corner parts of the semiconductor element. In a semiconductor device disclosed in Japanese Patent Application Publication No. 2009-170702, a thickness of solder that joins corner parts of a semiconductor element and a heat sink (a substrate body) is made thicker than a thickness of portions other than the corner parts of the semiconductor element. Thereby, thermal stress occurring in the semiconductor element when the temperature of the semiconductor element changes is reduced.